package com.aqie.rabbit.repositories;

import com.aqie.rabbit.bean.db.Group;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Optional;

public interface GroupRepository extends JpaRepository<Group, String> {
    Optional<Group> findByName(String name);

    @Query(value = "select g from Group g where g.name like?1 and g.description is not null and g.picture is not null")
    Optional<List<Group>> findByNameComplete(String groupName);
}
